import { styled } from 'styled-components';

interface AreaItemProps {
  coverbg: string;
  width: string
  isround: number;
}

export const AreaItenmV1Wrapper = styled.div<AreaItemProps> `
  width: ${props => props.width};
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  margin: 20px 0 18px 0;
  box-sizing: border-box;

  .cover {
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;

    &:hover {
      .coveer-bg {
        opacity: 1;
      }
    }

    &:hover {
      .shade {
        transition: all 500ms;
        .icon {
          opacity: 1;
        }
      }
    }

    &:hover {
      .shade {
        background-color: ${props => props.isround ? "" : "rgba(0, 0, 0, .3) !important"} ;
      }

      img {
        transform: ${props => props.isround ? "scale(0.9)" : "scale(1.2)"};
      }
    }

    img {
      position: relative;
      width: ${porps => porps.isround ? "220px" : "100%"};
      height: ${porps => porps.isround ? "220px" : "100%"};
      border-radius: ${porps => porps.isround ? "50%" : "8px"};
      transition: all 500ms;
      overflow: hidden;
    }

    .coveer-bg {
      position: absolute;
      width: ${porps => porps.isround ? "220px" : "100%"};
      height: ${porps => porps.isround ? "220px" : "100%"};
      top: 22px;
      opacity: 0;
      filter: blur(16px) opacity(0.6);
      transform: scale(0.92, 0.96);
      background: url(${poprs => poprs.coverbg}) 0% 0% / cover;
      z-index: -1;
      transition: all 250ms ease 0s;
      border-radius: ${porps => porps.isround ? "50%" : "10px"} !important;
    }

    .shade {
      position: absolute;
      display: flex;
      justify-content: center;
      align-items: center;
      inset: 0px;

      .icon {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 18%;
        height: 24%;
         opacity: 0;
        border-radius: 50%;
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        background-color: rgba(255, 255, 255, 0.14);
        transition: all 100ms ease;


        .play-bg {
          width: 50%;
          height: 50%;
        }
      }
    }
  }

  .song-info {
    margin-top: 8px;
    line-height: 18px;
    color: var(--color-text);

    .song-playcount {
      display: flex;
      flex-wrap: unset;
      height: 20px;
      box-sizing: border-box;
      align-content: center;
      font-size: 12px;
      opacity: .68;

      .play-icon {
        margin-top: 4px;
        margin-right: 6px;
        width: 8px;
        height: 8px;
      }
    }

    .songName {
      font-size: 16px;
      font-weight: 600;
      text-align: ${porps => porps.isround ? "center" : "start"};
      cursor: pointer;

      &:hover {
        text-decoration: underline;
      }
    }

    .author {
      line-height: 20px;
      color: rgb(255, 255, 255);
      opacity: 0.68;
      font-size: 12px !important;
      cursor: pointer;

      &:hover {
        text-decoration: underline;
      }
    }

  }
`;
